const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('broadcast_send', {
    id: {
      autoIncrement: true,
      type: DataTypes.INTEGER,
      allowNull: false,
      primaryKey: true
    },
    sip_ip: {
      type: DataTypes.STRING(255),
      allowNull: false,
      comment: "SIP服务器IP"
    },
    sip_port: {
      type: DataTypes.STRING(255),
      allowNull: false,
      comment: "SIP服务器端口"
    },
    user_id: {
      type: DataTypes.STRING(255),
      allowNull: false,
      comment: "呼叫方ID"
    },
    call_id: {
      type: DataTypes.STRING(255),
      allowNull: false,
      comment: "接收方ID"
    },
    name: {
      type: DataTypes.TEXT,
      allowNull: false,
      comment: "语音名字"
    },
    start_time: {
      type: DataTypes.BIGINT,
      allowNull: false,
      comment: "播报起始时间"
    },
    status: {
      type: DataTypes.INTEGER,
      allowNull: false,
      comment: "播报状态，0未播报，1已播报"
    }
  }, {
    sequelize,
    tableName: 'broadcast_send',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "id" },
        ]
      },
    ]
  });
};
